function count(...args) {
    return args.reduce((total, currentValue) => total + currentValue, 0);
}

console.log(count(1, 2, 3, 4));